package com.tzbank.common.controller;

import java.util.Map;

import javax.annotation.Resource;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.tzbank.common.service.BaseMsgTemplateService;
import com.tzbank.utils.ResultCode;
import com.tzbank.utils.ResultUtil;

@RestController
@RequestMapping("msgTemp")
public class BaseMsgTemplateController {

	@Resource
	private BaseMsgTemplateService baseMsgTemplateService;
	
	@PostMapping(value = "/add")
	public Map<String, Object> addMsgTemplate(@RequestBody Map<String, Object> reqBody) {
		Map<String, Object> result = baseMsgTemplateService.addMsgTemplate(reqBody);
		if ((boolean) result.get("success")) {
			return ResultUtil.resultMap("成功", ResultCode.RESULT_CODE_SUCCESS.code(), result);
		}
		return ResultUtil.resultMap("失败", ResultCode.RESUTL_CODE_FAILURE.code(), result);
	}

}
